#include "ISensor.h"
#include "VoltageReader.h"
#include "AnalogSensor.h"
#include "IAnalogDigitalConverter.h"

/*! \brief Creates a new instance of a VoltageReader
 *
 *  Creates a new instance of a VoltageReader
 * @param adc
 * @param channel
 * @param channelNumber
 * @param sensorNumber
 *
 */
VoltageReader::VoltageReader(
					    IAnalogDigitalConverter *adc,
					    UINT32 channel,
					    unsigned char channelNumber,
					    unsigned char sensorNumber,
					    std::string sensorName) :
		AnalogSensor(adc, channel)
{
	this->_channelNumber = channelNumber;
	this->_sensorNumber = sensorNumber;
	this->_sensorName = sensorName;
}

/*! \brief Default Destructor
 */
VoltageReader::~VoltageReader() { }

/*! \brief Channel Number used in CPT software
 *
 * @returns Channel number used in CPT software
 */
unsigned char VoltageReader::GetChannelNumber()
{
	return this->_channelNumber == '0' ? this->_channelNumber : this->_channelNumber + '0';
}

/*! \brief Sensor Number used in CPT software
 *
 * @returns Sensor number used in CPT software
 */
unsigned char VoltageReader::GetSensorNumber()
{
	return this->_sensorNumber == '0' ? this->_sensorNumber : this->_sensorNumber + '0';
}

/*! \brief Name of sensor
 *
 * @returns Name of sensor
 */
std::string VoltageReader::GetSensorName()
{
	return this->_sensorName;
}
